package com.hd.openapi.web.cotenollen;

import com.hd.openapi.common.ResponseResult;
import com.hd.openapi.common.ResultTable;
import com.hd.openapi.entity.AdminUser;
import com.hd.openapi.entity.ApiMapping;
import com.hd.openapi.servies.appmapperser;
import net.sf.jsqlparser.statement.select.Limit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/mapp")
public class mappdata {

    @Autowired
    private appmapperser ap;

    @RequestMapping("/table")
    public ResultTable table(@RequestParam(defaultValue = "1") Integer page,
                             @RequestParam(defaultValue = "10") Integer limit,
                             String gatewayApiName, String state){
        return ap.getalldata(page,limit,gatewayApiName,state) ;
    }
    @RequestMapping("/del")
    public ResponseResult del(Integer[] ids){
        return ap.deldata(ids);
    }
    @RequestMapping("/add")
    public ResponseResult add(ApiMapping adminUser){
        return ap.adddata(adminUser);
    }
    @RequestMapping("/update")
    public ResponseResult update(ApiMapping apiMapping){
        return ap.updatedata(apiMapping);
    }

}
